package com.rew.canteenbox.fragments;

import android.app.Fragment;

/**
 *  详情碎片(停止使用).
 *
 * Created by HuiWen Ren on 2016/11/7.
 */

public class FInfo extends Fragment{
/*
    private String dishes_name;

    // 布局变量声明.
    private View view;

    private TextView nameText;  //菜品名称.
    private TextView infoText;  //菜品详情.
    private ImageView picImg;   //菜品图片.


    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        view = inflater.inflate(R.layout.fragment_info, container,false);
        init();
        return view;
    }

    private void init(){
        if(dishes_name != null) {
            nameText = (TextView) view.findViewById(R.id.fg_info_name);
            infoText = (TextView) view.findViewById(R.id.fg_info_describe);
            picImg = (ImageView) view.findViewById(R.id.fg_info_img);

            // 信息初始化(测试).
            DishesInfoInit dishesInfoInit = new DishesInfoInit();
            //Dishes dishes = dishesInfoInit.getDishInfo(dishes_name);

            // 数据库信息加载(正式).


            // 更新布局.
            nameText.setText(dishes_name);
            //infoText.setText(dishes.getDishesInfo().getShort_info());
            //picImg.setImageResource(dishes.getPicId());
        } else {
            Log.e("Info init error","No dish info");
        }
    }

    public void setDishes_name(String dishes_name) {
        this.dishes_name = dishes_name;
    }
    */
}
